package viewmodel;

import java.util.ArrayList;
import java.util.List;

public class UserLevelModel {
	private int levelCode;
	private String levelName;
	private String levelImage;
	
	public UserLevelModel(int levelCode, String levelName, String levelImage) {
		this.levelCode = levelCode;
		this.levelName = levelName;
		this.levelImage = levelImage;
	}
	
	public UserLevelModel(int levelCode) {
		this.levelCode = levelCode;
		switch (levelCode) {
		case 1:
			this.levelName = "Super User";
			break;
		case 2:
			this.levelName = "Admin";
			break;
		default:
			this.levelName = "Memember";
			break;
		}
	}

	public int getLevelCode() {
		return levelCode;
	}
	
	public String getLevelName() {
		return levelName;
	}
	
	public String getLevelImage() {
		return levelImage;
	}

	public static List<UserLevelModel> createLevelList() {
		ArrayList<UserLevelModel> result = new ArrayList<UserLevelModel>();
		result.add(new UserLevelModel(1, "Super User","images/icons/black/16/bulls_eye.png"));
		result.add(new UserLevelModel(2, "Admin","images/icons/black/16/admin_user.png.png"));
		result.add(new UserLevelModel(3, "Memember","images/icons/black/16/user.png"));
		
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) return true;
		if (obj == null) return false;
		if (!(obj instanceof UserLevelModel)) { 
			return false;
		} else {
			UserLevelModel other = (UserLevelModel) obj;
			if (levelCode != other.levelCode)
				return false;
		}
		return true;
	}
	
	
}
